package com.avamanager.app.service.impl;

import java.util.List;
import com.avamanager.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.avamanager.app.mapper.AppRewardPunishmentMapper;
import com.avamanager.app.domain.AppRewardPunishment;
import com.avamanager.app.service.IAppRewardPunishmentService;

/**
 * 奖惩信息Service业务层处理
 * 
 * @author FenvyYe
 * @date 2022-08-15
 */
@Service
public class AppRewardPunishmentServiceImpl implements IAppRewardPunishmentService 
{
    @Autowired
    private AppRewardPunishmentMapper appRewardPunishmentMapper;

    /**
     * 查询奖惩信息
     * 
     * @param rewardPunishmentId 奖惩信息主键
     * @return 奖惩信息
     */
    @Override
    public AppRewardPunishment selectAppRewardPunishmentByRewardPunishmentId(Long rewardPunishmentId)
    {
        return appRewardPunishmentMapper.selectAppRewardPunishmentByRewardPunishmentId(rewardPunishmentId);
    }

    /**
     * 查询奖惩信息列表
     * 
     * @param appRewardPunishment 奖惩信息
     * @return 奖惩信息
     */
    @Override
    public List<AppRewardPunishment> selectAppRewardPunishmentList(AppRewardPunishment appRewardPunishment)
    {
        return appRewardPunishmentMapper.selectAppRewardPunishmentList(appRewardPunishment);
    }

    /**
     * 新增奖惩信息
     * 
     * @param appRewardPunishment 奖惩信息
     * @return 结果
     */
    @Override
    public int insertAppRewardPunishment(AppRewardPunishment appRewardPunishment)
    {
        appRewardPunishment.setCreateTime(DateUtils.getNowDate());
        return appRewardPunishmentMapper.insertAppRewardPunishment(appRewardPunishment);
    }

    /**
     * 修改奖惩信息
     * 
     * @param appRewardPunishment 奖惩信息
     * @return 结果
     */
    @Override
    public int updateAppRewardPunishment(AppRewardPunishment appRewardPunishment)
    {
        appRewardPunishment.setUpdateTime(DateUtils.getNowDate());
        return appRewardPunishmentMapper.updateAppRewardPunishment(appRewardPunishment);
    }

    /**
     * 批量删除奖惩信息
     * 
     * @param rewardPunishmentIds 需要删除的奖惩信息主键
     * @return 结果
     */
    @Override
    public int deleteAppRewardPunishmentByRewardPunishmentIds(Long[] rewardPunishmentIds)
    {
        return appRewardPunishmentMapper.deleteAppRewardPunishmentByRewardPunishmentIds(rewardPunishmentIds);
    }

    /**
     * 删除奖惩信息信息
     * 
     * @param rewardPunishmentId 奖惩信息主键
     * @return 结果
     */
    @Override
    public int deleteAppRewardPunishmentByRewardPunishmentId(Long rewardPunishmentId)
    {
        return appRewardPunishmentMapper.deleteAppRewardPunishmentByRewardPunishmentId(rewardPunishmentId);
    }
}
